package cn.lyh.FoodSystem.Controller;

import cn.lyh.FoodSystem.Dto.PageInfo;
import cn.lyh.FoodSystem.Dto.Result;
import cn.lyh.FoodSystem.Entity.Study;
import cn.lyh.FoodSystem.Service.StudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/study")
public class StudyController {

    /**
     * 查询学习记录（后台）
     */
    @Autowired
    private StudyService studyService;

    @PostMapping("/queryStudyAll")
    public Result queryStudyAll(@RequestBody PageInfo pageInfo){
        return studyService.queryStudyAll(pageInfo);
    }


    /**
     * 删除学习记录表
     */
    @PostMapping("/deleteStudy")
    public Result deleteStudy(@RequestBody Study study){
        return studyService.deleteStudy(study);
    }


}
